
<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Guide - Vue Carousel</title>
        <meta charset="utf-8">
        <meta name="description" content="Vue Carousel - A flexible, responsive, touch-friendly carousel for Vue.js">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

        <meta property="og:type" content="article">
        <meta property="og:title" content="Guide - Vue Carousel">
        <meta property="og:description" content="Vue Carousel - A flexible, responsive, touch-friendly carousel for Vue.js">
        <meta property="og:image" content="https:///images/logo.png">

        <meta name="twitter:card" content="summary">
        <meta name="twitter:title" content="Guide - Vue Carousel">
        <meta name="twitter:description" content="Vue Carousel - A flexible, responsive, touch-friendly carousel for Vue.js">
        <meta name="twitter:image" content="https:///images/logo.png">

        <link rel="icon" href="/vue-carousel/images/logo.png" type="image/x-icon">

        <link href='//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600|Roboto Mono' rel='stylesheet' type='text/css'>
        <link href='//fonts.googleapis.com/css?family=Dosis:500&text=Vue.js' rel='stylesheet' type='text/css'>

        <!-- main page styles -->
        <link rel="stylesheet" href="/vue-carousel/css/page.css">

        <!-- this needs to be loaded before guide's inline scripts -->
        <script src="/vue-carousel/js/vue.js"></script>
        <script src="/vue-carousel/js/vue-carousel.min.js"></script>
        <script>window.PAGE_TYPE = ""</script>
    </head>
    <body class="docs">        <div id="mobile-bar" >
            <a class="menu-button"></a>
            <a class="logo" href="/vue-carousel/"></a>
        </div>
        <div id="header">
  <a id="logo" href="/vue-carousel/">
    <img src="/vue-carousel/images/logo.png" alt="Vue Carousel">
    <span>Vue Carousel</span>
  </a>
  <ul id="nav">
    <li><a href="/vue-carousel/guide" class="nav-link current">Guide</a></li>
<li><a href="/vue-carousel/api" class="nav-link">API</a></li>
<li><a href="/vue-carousel/examples" class="nav-link">Examples</a></li>

  </ul>
</div>

        
            <div id="main" class="fix-sidebar">
                
                    
  <div class="sidebar">
    <ul class="main-menu">
      <li><a href="/vue-carousel/guide" class="nav-link current">Guide</a></li>
<li><a href="/vue-carousel/api" class="nav-link">API</a></li>
<li><a href="/vue-carousel/examples" class="nav-link">Examples</a></li>

    </ul>
  </div>

<div class="content  ">
    
    
      <h1>Guide</h1>
    
    <h2 id="Installation"><a href="#Installation" class="headerlink" title="Installation"></a>Installation</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install -S vue-carousel</span><br></pre></td></tr></table></figure>
<h2 id="Usage-Global"><a href="#Usage-Global" class="headerlink" title="Usage (Global)"></a>Usage (Global)</h2><p>You may install Vue Carousel globally:</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> Vue <span class="keyword">from</span> <span class="string">'vue'</span>;</span><br><span class="line"><span class="keyword">import</span> VueCarousel <span class="keyword">from</span> <span class="string">'vue-carousel'</span>;</span><br><span class="line"></span><br><span class="line">Vue.use(VueCarousel);</span><br></pre></td></tr></table></figure>
<p>This will make <strong>&lt;carousel&gt;</strong> and <strong>&lt;slide&gt;</strong> available to all components within your Vue app.</p>
<h2 id="Usage-Local"><a href="#Usage-Local" class="headerlink" title="Usage (Local)"></a>Usage (Local)</h2><p>Include the carousel directly into your component using import:</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> &#123; Carousel, Slide &#125; <span class="keyword">from</span> <span class="string">'vue-carousel'</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">export</span> <span class="keyword">default</span> &#123;</span><br><span class="line">  ...</span><br><span class="line">  components: &#123;</span><br><span class="line">    Carousel,</span><br><span class="line">    Slide</span><br><span class="line">  &#125;</span><br><span class="line">  ...</span><br><span class="line">&#125;;</span><br></pre></td></tr></table></figure>
<h2 id="HTML-Structure"><a href="#HTML-Structure" class="headerlink" title="HTML Structure"></a>HTML Structure</h2><p>Once the <strong>Carousel</strong> and <strong>Slide</strong> components are installed globally or imported, they can be used in templates in the following manner:</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">carousel</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">slide</span>&gt;</span></span><br><span class="line">    Slide 1 Content</span><br><span class="line">  <span class="tag">&lt;/<span class="name">slide</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">slide</span>&gt;</span></span><br><span class="line">    Slide 2 Content</span><br><span class="line">  <span class="tag">&lt;/<span class="name">slide</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">carousel</span>&gt;</span></span><br></pre></td></tr></table></figure>
    
    <div class="footer">
      Caught a mistake or want to contribute to the documentation?
      <a href="https://github.com/SSENSE/vue-carousel/blob/master/docs/source/guide/index.md" target="_blank">
        Edit this page on Github!
      </a>
    </div>
</div>

                
            </div>
            <script src="/vue-carousel/js/smooth-scroll.min.js"></script>
        

        <!-- main custom script for sidebars, version selects etc. -->
        <script src="/vue-carousel/js/common.js"></script>

        <!-- ga -->
        <script>
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

          ga('create', '', '');
          ga('send', 'pageview');
        </script>

        <!-- search -->
        <link href="//cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css" rel='stylesheet' type='text/css'>
        <link rel="stylesheet" href="/vue-carousel/css/search.css">
        <script src="//cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script>
        <script>
        [
          '#search-query-nav',
          '#search-query-sidebar'
        ].forEach(function (selector) {
          if (!document.querySelector(selector)) return
          // search index defaults to v2
          var match = window.location.pathname.match(/^\/(v\d+)/)
          var version = match ? match[1] : 'v2'
          docsearch({
            appId: 'BH4D9OD16A',
            apiKey: '85cc3221c9f23bfbaa4e3913dd7625ea',
            indexName: 'vuejs',
            inputSelector: selector,
            algoliaOptions: { facetFilters: ["version:" + version] }
          })
        })
        </script>

        <!-- fastclick -->
        <script src="//cdnjs.cloudflare.com/ajax/libs/fastclick/1.0.6/fastclick.min.js"></script>
        <script>
        document.addEventListener('DOMContentLoaded', function() {
          FastClick.attach(document.body)
        }, false)
        </script>
    </body>
</html>
